package cn.edu.njust.service.impl;

import cn.edu.njust.mapper.UserMapper;
import cn.edu.njust.service.trService;
import cn.edu.njust.util.SqlSessionFactoryUtils;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;

import java.util.List;

public class trServiceImpl implements trService {
    // 获取工厂对象
    SqlSessionFactory factory = SqlSessionFactoryUtils.getSqlSessionFactory();

    @Override
    public List<Integer> selectAllGrade(String idNo){
        //获取SqlSession对象
        SqlSession sqlSession = factory.openSession();
        //获取UserMapper
        UserMapper mapper = sqlSession.getMapper(UserMapper.class);

        List<Integer> transcipts = mapper.selectAllGrade(idNo);

        sqlSession.close();

        return transcipts;
    }
}
